#pragma once
#define WIN32_LEAN_AND_MEAN	
#define _CRT_SECURE_NO_DEPRECATE
#include "stdafx.h"
#include <windows.h>
#include <objbase.h>
#include "CommonFunction.h"

#include "UIlib.h"
using namespace DuiLib;

class CWordFirstPage : public CWindowWnd, public INotifyUI
{
public:
	CWordFirstPage()
	{

	};
	CWordFirstPage(CPaintManagerUI PaintManager):m_PaintManager(PaintManager)
	{

	};
	LPCTSTR GetWindowClassName() const
	{ 
		return _T("UIMainFrame"); 
	};
	UINT GetClassStyle() const 
	{ 
		return UI_CLASSSTYLE_FRAME | CS_DBLCLKS; 
	};
	void OnFinalMessage(HWND /*hWnd*/) 
	{ 
		/*delete this;*/
	};
	//////////////////////////////	
	void Init() { }
	void OnPrepare(TNotifyUI& msg) ;
	void Notify(TNotifyUI& msg);
	LRESULT HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);
	void InitWordCfgControl();
	void InitWordCfgBookCombo(LPCTSTR lpstrBook =NULL );
	void InitWordCfgGradeCombo(LPCTSTR lpstrGrade =NULL );
	void InitWordCfgUnitCombo(LPCTSTR lpstrUnit =NULL );
	void InitWordCfgNewWordCombo(LPCTSTR lpstrNewWord/* =NULL */);

	////////////////////////////////////////////////////////////////
	BOOL ExecuteSql(LPCTSTR pstrSql, ...);
	BOOL SaveSetup(LPCTSTR strParam, LPCTSTR strValue);
	BOOL SaveSetup(LPCTSTR strParam, int nValue)
	{
		CString strTmp;
		strTmp.Format(_T("%d"), nValue);
		return SaveSetup(strParam, strTmp);
	}
	void WordSetCfgControl(bool bIsBook);
public:
	CPaintManagerUI m_PaintManager;
	bool    m_bInitOK;
	emSkinId    m_nSkinId;
	bool    m_bRegistered;
	COptionUI* pOpt;
	CComboUI* pCombo;
	
};